Skip to content

feat(functions): rewrite deploy to per-function API with zero-config#383

Merged
yardend-wix merged 9 commits intofeature/functions-commandsfrom
feature/functions-deploy-command
Mar 12, 2026
Merged

feat(functions): rewrite deploy to per-function API with zero-config#383
yardend-wix merged 9 commits intofeature/functions-commandsfrom
feature/functions-deploy-command

Conversation

@yardend-wix
Copy link
Contributor

@yardend-wix yardend-wix commented Mar 8, 2026

Note

Description

This PR refactors the functions deploy command to deploy each function individually (per-function API endpoint) instead of in a single batch request. It adds support for deploying specific functions by name, a --force flag that prunes remote functions not found locally, and per-function progress output with timing and status (deployed/unchanged/error).

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • API layer: Replaced batch deployFunctions (PUT /backend-functions) with deploySingleFunction (PUT /backend-functions/:name); added listDeployedFunctions reordering
  • Schema: Renamed DeployFunctionsResponseSchemaDeploySingleFunctionResponseSchema with simplified { status: "deployed" | "unchanged" } response shape
  • Core deploy logic: Replaced pushFunctions with deployFunctionsSequentially that deploys one-by-one with onStart/onResult callbacks; added pruneRemovedFunctions to delete stale remote functions
  • CLI command: Added [names...] positional argument for targeted deploys; added --force flag to delete remote functions absent locally; replaced spinner with per-function progress logs showing name, status, and timing
  • New helpers: formatDeployResult.ts for per-function output formatting; parseNames.ts for comma-separated name parsing
  • Tests: Updated all mocks to per-function endpoints; added tests for unchanged status, deploy by name, name-not-found error, and --force + names conflict validation

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated docs/ (AGENTS.md) if I made architectural changes

Additional Notes

Per-function errors are now soft failures — a single function's deploy error is captured and reported in the summary without aborting the rest of the deploy. The --force flag is intentionally incompatible with named deploys to prevent accidental deletions.


🤖 Generated by Claude | 2026-03-12 14:24 UTC

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.44-pr.383.39531ce

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.44-pr.383.39531ce"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.44-pr.383.39531ce"
  }
}

Preview published to npm registry — try new features instantly!

yardend-wix and others added 2 commits March 9, 2026 11:30
Add a new `functions list` CLI command that lists all deployed functions
on the remote, showing automation counts. Restructure the functions
command group to use an index.ts that registers subcommands.

- Add ListFunctionsResponseSchema and FunctionInfo types to schema
- Add listDeployedFunctions API client function
- Create functions/list.ts command with automation count display
- Refactor functions/deploy.ts export to getDeployCommand
- Create functions/index.ts to register deploy + list subcommands
- Update program.ts to use getFunctionsCommand
- Add test mocks and 5 tests for the list command

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yardend-wix yardend-wix force-pushed the feature/functions-list-command branch from 813293a to 5c77e60 Compare March 9, 2026 09:35
…support

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yardend-wix yardend-wix force-pushed the feature/functions-deploy-command branch from ef46cce to 83f723c Compare March 9, 2026 09:59
kfirstri and others added 4 commits March 9, 2026 14:45
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deleted Base44APIMock.ts (replaced by TestAPIServer.ts in main) and added
mockFunctionsList / mockFunctionsListError methods to TestAPIServer so the
functions-list tests work with the new test infrastructure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kfirstri kfirstri moved this from Backlog to In review in CLI Development Mar 11, 2026
Base automatically changed from feature/functions-list-command to feature/functions-commands March 12, 2026 13:57
Combines per-function deploy additions (SingleFunctionDeployResponse,
mockSingleFunctionDeploy) with delete/list/pull from the feature branch.
Removes duplicate FunctionInfoSchema/ListFunctionsResponseSchema from
auto-merge, keeping the AutomationSchema version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yardend-wix yardend-wix merged commit 2a67ce2 into feature/functions-commands Mar 12, 2026
3 checks passed
@yardend-wix yardend-wix deleted the feature/functions-deploy-command branch March 12, 2026 14:24
@github-project-automation github-project-automation bot moved this from In review to Done in CLI Development Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants